package com.byit.webservice.service;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;

/**
 * 构建webservice接口
 *
 * @author wangx
 */
@WebService(name = "webService", targetNamespace = "http://webservice.byit.com")
public interface IWebService {

    String KEY = "jwt:session:";

    /**
     * 判断token是否有效
     *
     * @param userId
     * @param phone
     * @param token
     * @param comCode 机构编码
     * @param appCode 应用编码
     * @return
     */
    @WebMethod
    @WebResult(name = "String", targetNamespace = "http://webservice.byit.com")
    String isValidToken(@WebParam(name = "userId") String userId,
                        @WebParam(name = "phone") String phone,
                        @WebParam(name = "token") String token,
                        @WebParam(name = "comCode") String comCode,
                        @WebParam(name = "appCode") String appCode);

    /**
     * 查询用户信息
     *
     * @param phone
     * @param comCode 机构编码
     * @param appCode 应用编码
     * @return
     */
    String userInfo(@WebParam(name = "phone") String phone,
                    @WebParam(name = "comCode") String comCode,
                    @WebParam(name = "appCode") String appCode);

    /**
     * 获取用户认证状态
     *
     * @param userId
     * @param phone
     * @param token
     * @param comCode 机构编码
     * @param appCode 应用编码
     * @return
     */
    String userAuthStauts(@WebParam(name = "userId") String userId,
                          @WebParam(name = "phone") String phone,
                          @WebParam(name = "token") String token,
                          @WebParam(name = "comCode") String comCode,
                          @WebParam(name = "appCode") String appCode);
}